<?php

namespace Application\Model;

use Zend\InputFilter\Factory as InputFactory;
use Zend\InputFilter\InputFilter;
use Zend\InputFilter\InputFilterAwareInterface;
use Zend\InputFilter\InputFilterInterface;
use Zend\I18n\Validator;
class Image implements InputFilterAwareInterface {

    public $id;
    public $name;
    public $content;
    public $product_id;
    public $type;
    public $size;

    protected $inputFilter;

    public function exchangeArray($data) {
        $this->id = (isset($data['id'])) ? $data['id'] : null;
        $this->name = (isset($data['name'])) ? $data['name'] : null;
        $this->content = (isset($data['content'])) ? $data['content'] : null;
        $this->product_id = (isset($data['product_id'])) ? $data['product_id'] : null;
        $this->type = (isset($data['type'])) ? $data['type'] : null;
        $this->size = (isset($data['size'])) ? $data['size'] : null;



    }

    public function getArrayCopy() {
        return get_object_vars($this);
    }

    public function setInputFilter(InputFilterInterface $inputFilter) {
        $this->inputFilter = $inputFilter;
//            throw new \Exception("Not used");
    }

    public function getInputFilter() {
        if (!$this->inputFilter) {
			$inputFilter = new InputFilter();
			$factory     = new InputFactory();


			$inputFilter->add($factory->createInput(array(
					'name'     => 'desc',
					'required' => true,
			)));
			$this->inputFilter = $inputFilter;
		}

		return $this->inputFilter;
    }

}